<!DOCTYPE html>
<html>
<head>
    {include file="public/head"}
    <style>
        .grids-item{padding: 6px 0;}.dt{color: #999;}.list{display: block;border-bottom: 1px solid #eee;}
        .grids-item:before{content: none!important;}.grids-item:after{content: none!important;}
        .m-grids-2:before{content: none!important;}
        .trade-img{width: 28px;height: 28px;position: absolute;top: 0;}
    </style>
</head>
<body>
<div class="g-flexview">
    <header class="m-navbar">
        <a href="javascript:history.back();" class="navbar-item">
            <i class="back-ico"></i>
        </a>
        <div class="navbar-center"><span class="navbar-title">我的买单</span></div>
    </header>
    <div class="g-scrollview">
        <div id="J_Tab" class="m-tab">
            <ul class="tab-nav">
                <li class="tab-nav-item tab-active"><a href="javascript:;">全部</a></li>
                <li class="tab-nav-item"><a href="javascript:;">已创建</a></li>
                <li class="tab-nav-item"><a href="javascript:;">待处理</a></li>
                <li class="tab-nav-item"><a href="javascript:;">已完成</a></li>
            </ul>
            <div class="tab-panel">
                <div class="tab-panel-item tab-active" title="全部">
                    {volist name="buyList" id="index"}
                    <a href="/index/trade/tradeDetail?id={$index.id}" class="list">
                        <div class="m-grids-2">
                            <div class="grids-item" id="g">
                                <img src="{:getInfo($index.user_id)['avatar']}" alt="" class="trade-img">
                                <div class="grids-txt">{:getInfo($index.user_id)['nickname']}</div>
                            </div>
                            <div class="grids-item">
                                <div class="grids-txt dt">{$index.add_time|date="Y-m-d H:i:s",###}</div>
                            </div>
                        </div>
                        <div class="m-grids-2">
                            <div class="grids-item">
                                <div class="grids-txt">HX币 {$index.money}</div>
                            </div>
                            <div class="grids-item">
                                <div class="grids-txt">单价 ￥{$index.unit_price}</div>
                            </div>
                        </div>
                        <div class="m-grids-2">
                            <div class="grids-item">
                                <div class="grids-txt" style="color: #000088;">支付宝,微信,银联</div>
                            </div>
                            <div class="grids-item">
                                <div class="grids-txt">
                                    {switch name="$index.state"}
                                    {case value="0"}已创建{/case}
                                    {case value="1"}待处理{/case}
                                    {case value="2"}已完成{/case}
                                    {/switch}
                                </div>
                            </div>
                        </div>
                    </a>
                    {/volist}
                </div>
                <div class="tab-panel-item" title="已创建">
                    {volist name="isConfirm" id="index"}
                    <a href="/index/trade/tradeDetail?id={$index.id}" class="list">
                        <div class="m-grids-2">
                            <div class="grids-item" id="g">
                                <img src="{:getInfo($index.user_id)['avatar']}" alt="" class="trade-img">
                                <div class="grids-txt">{:getInfo($index.user_id)['nickname']}</div>
                            </div>
                            <div class="grids-item">
                                <div class="grids-txt dt">{$index.add_time|date="Y-m-d H:i:s",###}</div>
                            </div>
                        </div>
                        <div class="m-grids-2">
                            <div class="grids-item">
                                <div class="grids-txt">HX币 {$index.money}</div>
                            </div>
                            <div class="grids-item">
                                <div class="grids-txt">单价 ￥{$index.unit_price}</div>
                            </div>
                        </div>
                        <div class="m-grids-2">
                            <div class="grids-item">
                                <div class="grids-txt" style="color: #000088;">支付宝,微信,银联</div>
                            </div>
                            <div class="grids-item">
                                <div class="grids-txt">已创建</div>
                            </div>
                        </div>
                    </a>
                    {/volist}
                </div>
                <div class="tab-panel-item" title="待处理">
                    {volist name="isPay" id="index"}
                    <a href="/index/trade/tradeDetail?id={$index.id}" class="list">
                        <div class="m-grids-2">
                            <div class="grids-item" id="g">
                                <img src="{:getInfo($index.user_id)['avatar']}" alt="" class="trade-img">
                                <div class="grids-txt">{:getInfo($index.user_id)['nickname']}</div>
                            </div>
                            <div class="grids-item">
                                <div class="grids-txt dt">{$index.add_time|date="Y-m-d H:i:s",###}</div>
                            </div>
                        </div>
                        <div class="m-grids-2">
                            <div class="grids-item">
                                <div class="grids-txt">HX币 {$index.money}</div>
                            </div>
                            <div class="grids-item">
                                <div class="grids-txt">单价 ￥{$index.unit_price}</div>
                            </div>
                        </div>
                        <div class="m-grids-2">
                            <div class="grids-item">
                                <div class="grids-txt" style="color: #000088;">支付宝,微信,银联</div>
                            </div>
                            <div class="grids-item">
                                <div class="grids-txt">待处理</div>
                            </div>
                        </div>
                    </a>
                    {/volist}
                </div>
                <div class="tab-panel-item" title="已完成">
                    {volist name="isComplete" id="index"}
                    <a href="/index/trade/tradeDetail?id={$index.id}" class="list">
                        <div class="m-grids-2">
                            <div class="grids-item" id="g">
                                <img src="{:getInfo($index.user_id)['avatar']}" alt="" class="trade-img">
                                <div class="grids-txt">{:getInfo($index.user_id)['nickname']}</div>
                            </div>
                            <div class="grids-item">
                                <div class="grids-txt dt">{$index.add_time|date="Y-m-d H:i:s",###}</div>
                            </div>
                        </div>
                        <div class="m-grids-2">
                            <div class="grids-item">
                                <div class="grids-txt">HX币 {$index.money}</div>
                            </div>
                            <div class="grids-item">
                                <div class="grids-txt">单价 ￥{$index.unit_price}</div>
                            </div>
                        </div>
                        <div class="m-grids-2">
                            <div class="grids-item">
                                <div class="grids-txt" style="color: #000088;">支付宝,微信,银联</div>
                            </div>
                            <div class="grids-item">
                                <div class="grids-txt">已完成</div>
                            </div>
                        </div>
                    </a>
                    {/volist}
                </div>
            </div>
        </div>
    </div>
    <a href="/index/user/newBuy" class="btn-block btn-primary">创建买单</a>
</div>
{include file="public/js"}
<script>
    !function ($) {
        var $tab = $('#J_Tab');
        $tab.tab({
            nav: '.tab-nav-item',
            panel: '.tab-panel-item',
            activeClass: 'tab-active'
        });
        $tab.find('.tab-nav-item').on('open.ydui.tab', function (e) {
            console.log('索引：%s - [%s]正在打开', e.index, $(this).text());
        });
        $tab.find('.tab-nav-item').on('opened.ydui.tab', function (e) {
            console.log('索引：%s - [%s]已经打开了', e.index, $(this).text());
        });
    }(jQuery);
</script>
</body>
</html>